package com.ruoyi.project.hissystem.service.impl;

import com.ruoyi.common.exception.CustomException;
import com.ruoyi.project.hissystem.domain.HisDepartment;
import com.ruoyi.project.hissystem.mapper.HisDepartmentMapper;
import com.ruoyi.project.hissystem.service.IHisDepartmentService;
import com.ruoyi.project.system.domain.SysPost;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class HisDepartmentServiceImpl implements IHisDepartmentService {
    @Autowired
    private HisDepartmentMapper hisDepartmentMapper;

    //动态查询科室信息
    @Override
    public List<HisDepartment> selDepartmentList(HisDepartment hisDepartment) {
        return hisDepartmentMapper.selDepartmentList(hisDepartment);
    }

    /**
     * 科室新增
     * @param hisDepartment 科室信息
     * @return
     */
    @Override
    public int insertDepartment(HisDepartment hisDepartment) {
        return hisDepartmentMapper.insertDepartment(hisDepartment);
    }


    /**
     * 通过科室ID查询科室信息
     *
     * @param departId 科室ID
     * @return 角色对象信息
     */
    @Override
    public HisDepartment selectDeapartById(Long departId) {
        return hisDepartmentMapper.selectDepartmentById(departId);
    }
    /**
     * 修改保存科室信息
     *
     * @param hisDepartment 科室信息
     * @return 结果
     */
    @Override
    public int updateDepartment(HisDepartment hisDepartment) {
        return hisDepartmentMapper.updateDepartment(hisDepartment);
    }

    /**
     * 批量删除岗位信息
     *
     * @param departIds 需要删除的岗位ID
     * @return 结果
     * @throws Exception 异常
     */
    @Override
    public int deleteDepartmentByIds(Long[] departIds) {
        return hisDepartmentMapper.deleteDepartmentByIds(departIds);
    }
}
